package
{
	import org.anivision.*;
	
	import org.aswing.*;
	import org.aswing.geom.*;
	import org.aswing.event.*;

	import flash.ui.ContextMenu;
	import flash.display.*;
	import flash.events.*;
	
	/**
	 * App entry Class
	 */
	public class Main extends Sprite
	{
		private var _main:AppMain;
		private var _loadingFrame:JFrame;
		
		public function Main():void {
			AsWingManager.initAsStandard(this);
			
			/*
			_loadingFrame = JOptionPane.showMessageDialog(
				"Initing", 
				"Loading LAFs, please wait...").getFrame();
			_loadingFrame.setClosable(false);
			
			LookAndFeelManager.getIns().load(__lafLoaded);
			*/
			
			start();
		}
	
		private function __lafLoaded():void {
			_loadingFrame.dispose();
			_loadingFrame = null;
			start();
		}
	
		private function start():void {
			_main = new AirMain(this);
			_main.show();
		
			stage.addEventListener(Event.RESIZE, __stageResized);
			__stageResized(null);
		}
		
		private function __stageResized(e:Event):void {
			_main.setSizeWH(stage.stageWidth, stage.stageHeight);
		}
	}
}